	.data
	.text
	.global main
main: 
	addi $8, $8, 4 
	; A=4
	sw 4($29), $8 
	addi $9, $9, 5 
	; B=5
	sw 8($29), $9
	addi $10, $10, 7 
	; C=7
	sw 12($29), $10
	addi $11, $11, 3 
	; D=3
	sw 16($29), $11

	lw $9, 8($29) 
	; B
	lw $10, 12($29) 
	; C
	add $13, $9, $10 
	; X= B+C
	sw 20($29), $13

	lw $11, 16($29) 
	; D
	sub $14, $11, $10  
	; Y= D-C
	sw 24($29), $14

	lw $8, 4($29) 
	; A
	add $15, $8,$10
	; q= A+c
	sub $15, $15,$9
	; q-= B
	mult $15, $15,$10
	; q= q*C
	sub $15, $15,$13
	; q-= X
	div $15,$15,$14
	; q= q/Y, big stall..
	
	mult $8, $13, $14
	; A = X*Y
	add $16, $0, 3
	mult $8, $8, $16
	; A*= 3
	sw 4($29), $8

	; evading DivStall, Z=q
	movi2fp f2,$15	
	j Finish

Finish:         
	trap 0
